package com.jbm.jbmsupplier.util;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-03-14.
 */

public class PointsEntity  extends com.jbm.jbmsupplier.util.ICtrl implements Serializable {
    private static final long serialVersionUID = 3223246268995573300L;
    private int pointsId;
    private Integer loginId;
    private Integer amount;  //积分数量
    private String type;    //积分来源code 每日登录 开门等
    private Timestamp createDate;
    private PointsRuleEntity ruleEntity;  //积分来源实体类 取memo值得到中文名称

    public PointsEntity(){}
    public PointsEntity(String method,Integer loginId,Integer amount,String type,int start,int pagesize){
        this.method=method;
        this.loginId=loginId;
        this.amount=amount;
        this.type=type;
        this.start=start;
        this.pagesize=pagesize;

    }

    public int getPointsId() {
        return pointsId;
    }

    public void setPointsId(int pointsId) {
        this.pointsId = pointsId;
    }


    public Integer getLoginId() {
        return loginId;
    }

    public void setLoginId(Integer loginId) {
        this.loginId = loginId;
    }


    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PointsEntity that = (PointsEntity) o;

        if (pointsId != that.pointsId) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (loginId != null ? !loginId.equals(that.loginId) : that.loginId != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = pointsId;
        result = 31 * result + (loginId != null ? loginId.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }

    public PointsRuleEntity getRuleEntity() {
        return ruleEntity;
    }

    public void setRuleEntity(PointsRuleEntity ruleEntity) {
        this.ruleEntity = ruleEntity;
    }
}
